<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;

class TestCommand extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'open:test:helloworld {data}';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Hello world';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * @return mixed
     */
    public function handle()
    {
        $data = $this->argument('data');
        $data = json_decode($data,true);            //$data大部分为二层json字符串
        $common=new \Common();
        $data['result']=$common->helloworld();
        echo json_encode($data,JSON_HEX_QUOT|JSON_HEX_AMP|JSON_HEX_TAG|JSON_HEX_APOS |JSON_PARTIAL_OUTPUT_ON_ERROR);//
    }
}
